package com.demo.chapter8.patter.template;

import java.util.function.Consumer;

public class OnlineBankingLambda {
	
	public void processCustomer(int id, Consumer<Customer> makeCustomerHappy){
        Customer c = Database.getCustomerWithId(id);
        makeCustomerHappy.accept(c);
    }
	
	static private class Customer {}
	
	static private class Database{
        static Customer getCustomerWithId(int id){ return new Customer();}
    }
	
	public static void main(String[] args) {
		OnlineBankingLambda l = new OnlineBankingLambda();
		l.processCustomer(1, c -> System.out.println("hello: " + c.toString()));
	}

}
